/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package io.renren.modules.app.utils;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.renren.modules.app.entity.UserEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Map;


@Component
public class LoginUtils {
    private Logger logger = LoggerFactory.getLogger(getClass());


    /**
     * 生成jwt token
     */
    public Map<String, Object> setLoginInfo(UserEntity user, Map<String, Object> params) {
        String userid = user.getCUSERID();
        String groupid = user.getPK_GROUP();
        String pkorg = user.getPK_ORG();
        params.put("userid",userid);
        params.put("groupid",groupid);
        params.put("pkorg",pkorg);

//        "userid" -> "1001A710000000001RIJ"
//        "groupid" -> "0001771000000000034H"
//        "pkorg" -> "0001A9100000001ZFZGD"
        return params;
    }

}
